package com.zpark.drug.pojo;

import com.zpark.drug.common.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 药品信息
 */
@Table(name = "drug")
public class Drug {
    @Id
    @Column(name = "drug_id")
    private Integer id;
    @Column(name = "drug_number")
    private String number;
    @Column(name = "drug_name")
    private String name;
    @Column(name = "drug_formula")
    private String formula;
    @Column(name = "drug_dosage")
    private String dosage;
    @Column(name = "drug_price")
    private Integer price;
    @Column(name = "drug_supplier")
    private String supplier;
    @Column(name = "drug_producttime")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date producttime;
    @Column(name = "drug_warranty")
    private String warranty;
    @Column(name = "drug_stock")
    private Integer stock;

    public String getProducttimeStr(){
        return DateUtil.dateConvert(producttime);
    }


    public String getWarranty() {
        return warranty;
    }

    public void setWarranty(String warranty) {
        this.warranty = warranty;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public String getDosage() {
        return dosage;
    }

    public void setDosage(String dosage) {
        this.dosage = dosage;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public Date getProducttime() {
        return producttime;
    }

    public void setProducttime(Date producttime) {
        this.producttime = producttime;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }
}
